{% extends 'extend.html' %}
{% load common_tag %}
{% load compress %}
{% block head %}
    {% if article.tags %}
        <meta name="keywords" content="{{ article.tags }}{{ article.title }}">
    {% else %}
        <meta name="keywords" content="{{ article.title }}">
    {% endif %}
    <meta name="description" content="{{ article.subject|clear }}">
    <meta property="og:type" content="blog">
    <meta property="og:image" content="{{ article.image|url }}">
    <meta property="og:release_date" content="{{ article.createDate|date:'Y-m-d H:i:s' }}">
    <meta property="og:title" content="{{ article.title }}">
    <meta property="og:description" content="{{ article.subject|clear }}">
    <meta property="og:author" content="{{ article.user }}">
    {% compress css %}
        <link rel="stylesheet" type="text/css" href="/static/css/code.css"/>
        <link rel="stylesheet" type="text/css" href="/static/css/markdown.css"/>
    {% endcompress %}
{% endblock %}

{% block title %}{{ article.title }}-{{ commonData.configs.name }} {% endblock %}
{% block banner %}
{% endblock %}
{% block body %}
    <ol class="breadcrumb">
        <li class="breadcrumb-item"><a href="/">首页</a></li>
        <li class="breadcrumb-item"><a
                href="{% url 'category_alias' article.category.alias %}">{{ article.category.name }}</a></li>
        <li class="breadcrumb-item active">{{ article.title }}</li>
    </ol>
    <div class="block">
        <div class="block-main">
            <div>
                <h1 class="article-title">{{ article.title }}</h1>
            </div>

            <div class="article">
                <div class="info">
                <span class="date"><span
                        class="glyphicon glyphicon-calendar"></span>{{ article.createDate|date:"Y-m-d" }}</span>
                    <span>
                    <span class="glyphicon glyphicon-pencil"></span>
                    <span>发表在 <a
                            href="{% url 'category_alias' article.category.alias %}">{{ article.category.name }}</a> </span>
                </span>
                    <span class="hits">
                <span class="glyphicon glyphicon-eye-open"></span>
                <span>{{ article.hits }}</span>
                </span>
                </div>

                {{ article.content|safe }}
            </div>
            <div class="article-tips">
                <div>作者：<a href="{{ request.scheme }}://{{ request.META.HTTP_HOST }}">{{ commonData.configs.name }}</a></div>
                <div>出处：<a
                    href="{{ request.scheme }}://{{ request.META.HTTP_HOST }}{% url 'article' article.sid %}"
                    target="_blank">{{ request.scheme }}://{{ request.META.HTTP_HOST }}/article/{{ article.sid }}</a></div>
                <div>本站使用「署名 4.0 国际」创作共享协议，转载请在文章明显位置注明作者及出处。</div>
            </div>

        </div>
    </div>
    <div class="block">
        <div class="block-main">
            <h4>相关文章</h4>
            {% for item in recommends %}
                <div><a href="{% url 'article' item.sid %}" title="{{ item.title }}">{{ item.title }}</a></div>
            {% endfor %}
        </div>
    </div>
    <script type="text/javascript">
        window._PAGE_CONFIG = {
            SID: '{{ sid }}',
            TARGET_ID: '{{ article.id }}',
            TYPE: 0
        }
    </script>
    {% include 'comment.html' %}
    {% compress js %}
    {% endcompress %}
{% endblock %}